feat: auto-enable SLSA L3 features when provenance.slsa
is true
#250
+631
−42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR implements automatic SLSA Level 3 feature activation when
provenance.slsa: true
is configured in WORKSPACE.yaml.Problem
Previously, SLSA L3 features required manual configuration of multiple environment variables:
provenance.slsa: true
only enabled metadata generation, not runtime featuresSolution
When
provenance.slsa: true
is set, automatically enable:LEEWAY_SLSA_CACHE_VERIFICATION=true
)LEEWAY_ENABLE_IN_FLIGHT_CHECKSUMS=true
)LEEWAY_DOCKER_EXPORT_TO_CACHE=true
)LEEWAY_SLSA_SOURCE_URI
from Git origin)Key Changes
1. Workspace Auto-Enablement
2. Five-Layer Precedence for Docker Export
3. Package-Level Override
4. Artifact Distinguishability
Artifacts built with SLSA include
provenance: version=3 slsa
in manifest, ensuring different cache keys than legacy builds.Technical Changes
ExportToCache bool
→ExportToCache *bool
(distinguishes "not set" from "explicitly false")ApplySLSADefaults()
in workspace loadingbuildDocker()
Usage Examples
Enable SLSA L3 globally:
Package opts out:
User override for testing:
export LEEWAY_DOCKER_EXPORT_TO_CACHE=false leeway build :backend
CLI override:
Backward Compatibility
✅ 100% backward compatible:
provenance.slsa: true
unchangedRelated Issue(s)
Fixes https://linear.app/ona-team/issue/CLC-2018/implement-slsa-l3-workspace-driven-auto-enablement-leeway
How to test
1. Verify Auto-Enablement
2. Test Precedence Layers
3. Test Artifact Distinguishability
4. Run Tests
Expected: 16 new test scenarios, all passing
5. Test Backward Compatibility
Documentation
/hold